/*
 * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
 *
 * Copyright (C) 2019 THL A29 Limited, a Tencent company.  All rights reserved.
 *
 * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
 *
 * A copy of the MIT License is included in this file.
 *
 *
 * Terms of the MIT License:
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.tencent.bk.codecc.defect.constant;

/**
 * 告警模块的常量
 *
 * @version V1.0
 * @date 2019/4/23
 */
public interface DefectConstants
{
    /**
     * 1073741824表示的是其他语言  2^32
     */
    long OTHER_LANG = 1073741824L;
    /**
     * 上报分析步骤的状态标记,包括成功、失败、进行中、中断
     */
    int TASK_FLAG_SUCC = 1;
    int TASK_FLAG_FAIL = 2;
    int TASK_FLAG_PROCESSING = 3;
    int TASK_FLAG_ABORT = 4;

    /**
     * 任务状态，0-启用，1-停用
     */
    enum TaskStatus
    {
        ENABLE(0),
        DISABLE(1);

        private int value;

        TaskStatus(int value)
        {
            this.value = value;
        }

        public int value()
        {
            return value;
        }
    }

    /**
     * 工具集成进展状态：T-测试，P-发布
     */
    enum ToolIntegratedStatus
    {
        T,
        P;
    }

    /**
     * 工具处理模式
     */
    enum ToolPattern
    {
        LINT,
        COVERITY,
        KLOCWORK,
        CCN,
        DUPC,
        TSCLUA;
    }

    /**
     * 工具跟进状态: 0/1-未跟进，2-体验，3-接入中，4-已接入，5-挂起，6-下架/停用
     */
    enum FOLLOW_STATUS
    {
        NOT_FOLLOW_UP_0(0),
        NOT_FOLLOW_UP_1(1),
        EXPERIENCE(2),
        ACCESSING(3),
        ACCESSED(4),
        HANG_UP(5),
        WITHDRAW(6);

        private int value;

        FOLLOW_STATUS(int value)
        {
            this.value = value;
        }

        public int value()
        {
            return value;
        }
    }

    /**
     * 缺陷类型
     */
    enum DefectType
    {
        NEW(1),
        HISTORY(2);

        private int value;

        DefectType(int value)
        {
            this.value = value;
        }

        public int value()
        {
            return value;
        }

        public String stringValue()
        {
            return String.valueOf(value);
        }
    }

    /**
     * 缺陷状态
     */
    enum DefectStatus
    {
        NEW(1),
        FIXED(2),
        IGNORE(4),
        PATH_MASK(8),
        CHECKER_MASK(16);

        private int value;

        DefectStatus(int value)
        {
            this.value = value;
        }

        public int value()
        {
            return value;
        }
    }

    /**
     * 严重程度类别：严重（1），一般（2），提示（4）
     */
    enum DefectSeverity
    {
        SERIOUS(1),
        NORMAL(2),
        PROMPT(4);

        private int value;

        DefectSeverity(int value)
        {
            this.value = value;
        }

        public int value()
        {
            return value;
        }
    }


    enum CheckerPackageStatus
    {
        CLOSE(1),
        OPEN(2);

        private Integer value;

        CheckerPackageStatus(Integer value)
        {
            this.value = value;
        }

        public Integer getValue()
        {
            return value;
        }

    }


    enum CheckerStatus
    {
        CLOSE(1),
        OPEN(2);

        private Integer value;

        CheckerStatus(Integer value)
        {
            this.value = value;
        }

        public Integer getValue()
        {
            return value;
        }

    }

    /**
     * 重复代码块类型，source表示源代码块，target表示目标代码块
     */
    enum DupcCodeBlockType
    {
        SOURCE("source"),
        TARGET("target");

        private String value;

        DupcCodeBlockType(String value)
        {
            this.value = value;
        }

        public String value()
        {
            return value;
        }
    }


    /**
     * CodeCC创建任务元素类型
     */
    String LINUX_CODECC_SCRIPT = "linuxCodeCCScript";

    /**
     * 蓝盾流水线创建任务元素类型
     */
    String LINUX_PAAS_CODECC_SCRIPT = "linuxPaasCodeCCScript";


    /**
     * -1表示该元数据无效，应被红线拦截
     */
    long FORBIDDEN_COUNT = -1L;

    /**
     * -1表示该元数据无效，应被红线拦截
     */
    double FORBIDDEN_COUNT_F = -1.0D;

    /**
     * 0表示该元数据不需要被拦截
     */
    long PASS_COUNT = 0L;


}
